package team.lourd.network.system.own.domain.pretrem;

import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.data.mongodb.core.mapping.Document;

import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import java.util.List;

@NoArgsConstructor
@Data
@Document("pm_wynl")
@Getter
@Setter
public class PMWynl {

    private String id;

    private List<AttrBean> inputs;

    private List<AttrBean> outs;

    private String command;

    @NoArgsConstructor
    @Data
    private class AttrBean {
        private String name;//参数名

        private String description;//描述

        @Enumerated(EnumType.ORDINAL)
        private AttrTypeBean type;//参数类型

        private boolean isnecessary;//必要参数
    }

    private enum AttrTypeBean {
        TYPE_String("String"),//字符串

        TYPE_Int("int"),//整数

        TYPE_Double("double"),//浮点数

        TYPE_Date("date");//日期

        private final String value;

        AttrTypeBean(String value) {
            this.value = value;
        }

        public String getValue() {
            return value;
        }
    }
}
